﻿using GlobalStringFormatter;
using Samples.DependencyInjectedConsole.Accounts;

namespace Samples.DependencyInjectedConsole.GStrings
{
    public class USDGString : GString<Currency, double>
    {
        public USDGString()
        {
            Formatters.Add(v => v < 1000, v => string.Format("{0:C}", v));
            Formatters.Add(v => v >= 1000 && v < 1000000, v => string.Format("{0:C}k", v / 1000));
            Formatters.Add(v => v >= 1000000, v => string.Format("{0:C}m", v / 1000000));
        }
    }
}
